﻿using System;
using System.Threading;

namespace BaseSyntax.ThreadTest
{
	public class ThreadBase:ITest
	{
		public static int repeatNum = 1000;
		
		public void Test()
		{
			ThreadStart threadStart = PrintPlus;
			System.Threading.Thread thread = new System.Threading.Thread(threadStart);
			
			thread.Start();
			Console.WriteLine(thread.Priority);

			for (int i = 0; i < repeatNum; i++)
			{
				Console.Write('-');
			}
			//等候工作者线程完成
			thread.Join();
		}
		
		void PrintPlus()
		{
			for (int i = 0; i < repeatNum; i++)
			{
				Console.Write('+');
			}
		}
	}
}